﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;

namespace Gollie.Graph
{
	public class GraphGridLines
	{
		double xStep = 0;
		double yStep = 0;
		int lineLength = 0;
		int blankLength = 0;

		public GraphGridLines()
			: this(0, 0, 0, 0)
		{
		}

		public GraphGridLines(double xStep, double yStep)
			: this(xStep, yStep, 0, 0)
		{
		}

		public GraphGridLines(double xStep, double yStep, int lineLength, int blankLength)
		{
			this.xStep = xStep;
			this.yStep = yStep;
			this.lineLength = lineLength;
			this.blankLength = blankLength;
		}

		public string Url
		{
			get
			{
				if (this.lineLength == 0)
					return "";

				StringBuilder str = new StringBuilder("chg=", 64);

				str.Append(Graph.StringDouble(xStep));
				str.Append(",");
				str.Append(Graph.StringDouble(yStep));
				str.Append(",");
				str.Append(lineLength.ToString());
				str.Append(",");
				str.Append(blankLength.ToString());

				return str.ToString();
			}
		}

		public double XStep
		{
			get { return this.xStep; }
			set { this.xStep = value; }
		}

		public double YStep
		{
			get { return this.yStep; }
			set { this.yStep = value; }
		}

		public int LineLength
		{
			get { return this.lineLength; }
			set { this.lineLength = value; }
		}

		public int BlankLength
		{
			get { return this.blankLength; }
			set { this.blankLength = value; }
		}
	}
}